<div class="row-content am-cf">
	<div class="row">
		<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
			<div class="widget am-cf">
				<div class="widget-head am-cf">
					<div class="widget-title am-fl">编辑公司</div>
					<div class="widget-function am-fr">
						<a href="javascript:;" class="am-icon-cog"></a>
					</div>
				</div>
				<div class="widget-body am-fr">
					<form class="am-form tpl-form-line-form" id="companyForm" method="post">
						<div class="am-form-group">
							<label for="companyCode" class="am-u-sm-2 am-form-label">公司编码：
								<span class="tpl-form-line-small-title"></span>
							</label>
							<div class="am-u-sm-10">
								<input type="text" id="companyCode" class="tpl-form-input" placeholder="公司编码" name="companyCode"  required="required" th:value="${company.companyCode}" readonly="readonly"/> 
							</div>
						</div>
						<div class="am-form-group">
							 <label for="account" class="am-u-sm-2 am-form-label"><span class="text-red"> *</span>公司名称：
								<span class="tpl-form-line-small-title"> </span>
							</label> 
							<div class="am-u-sm-10">
							    <input type="hidden" id="id" name="id" th:value="${company.id}">
								<input type="text" id="companyName" class="tpl-form-input" placeholder="公司名称" name="companyName"  required="required"  th:value="${company.companyName}"/> 
							</div>
						</div>
						
						<div class="am-form-group">
							<label for="repassword" class="am-u-sm-2 am-form-label">公司英文名称：
								<span class="tpl-form-line-small-title"></span>
							</label>
							<div class="am-u-sm-10">
								<input type="text" id="companyNameEn" class="tpl-form-input" placeholder="公司英文名称" name="companyNameEn"  th:value="${company.companyNameEn}" /> 
							</div>
						</div>
						
						<div class="am-form-group">
							<label for="name" class="am-u-sm-2 am-form-label">公司简称：
								<span class="tpl-form-line-small-title"></span>
							</label>
							<div class="am-u-sm-10">
								<input type="text" id="companySname" class="tpl-form-input" placeholder="请输入公司简称" name="companySname"  th:value="${company.companySname}"/>
							</div>
						</div>

					

						<div class="am-form-group">
							<label for="desc" class="am-u-sm-2 am-form-label">地址 ：
							<span class="tpl-form-line-small-title"></span></label>
							<div class="am-u-sm-10">
								<input type="text" id="adress" name="adress" placeholder="请输入地址" th:value="${company.adress}"/>
							</div>
						</div>
						<div class="am-form-group">
							<label for="desc" class="am-u-sm-2 am-form-label">英文地址 ：
							<span class="tpl-form-line-small-title"></span></label>
							<div class="am-u-sm-10">
								<input type="text" id="addressEn" name="addressEn" placeholder="请输入英文地址" th:value="${company.addressEn}" />
							</div>
						</div>
						
						<div class="am-form-group">
							<label for="desc" class="am-u-sm-2 am-form-label">传真： 
							<span class="tpl-form-line-small-title"></span></label>
							<div class="am-u-sm-10">
								<input type="text" id="fax" name="fax" placeholder="请输入传真" th:value="${company.fax}" />
							</div>
						</div>
						
						<div class="am-form-group">
							<label for="email" class="am-u-sm-2 am-form-label">邮件：
							<span class="tpl-form-line-small-title"></span></label>
							<div class="am-u-sm-10">
								<input type="text" id="email" name="email" placeholder="请输入邮件" th:value="${company.email}" />
							</div>
						</div>

						<div class="am-form-group">
							<div class="am-u-sm-10 am-u-sm-push-2">
								
								<button type="button" onclick="javascript:$('#companyForm').submit();"
									class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
										<button type="button" onclick="loadPage('company/listUI')"
									class="am-btn am-btn-success tpl-btn-bg-color-success ">返回</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>

	</div>
	<script th:inline="javascript">
	<![CDATA[
	$('select').selected();
	validatecompanyForm();
	function validatecompanyForm(){    
	    $('#companyForm').validate({
	        errorElement : 'span',
	        errorClass : 'am-icon-times',
	        focusInvalid : true,
	        onkeyup:false,
	        ignore : "",
	        rules : {
	            companyCode : {
	                required : true,
	                maxlength : 15
	            },
	            companyName : {
	                required : true,
	                maxlength : 50
	            },
	            companyNameEn : {
	            	maxlength : 50
	            },
	            companySname : {
	            	maxlength : 50
	            },
	            adress : {
	            	maxlength : 50
	            },
	            addressEn : {
	            	maxlength : 50
	            },
	            email: {
	            	email: true,
	            	maxlength : 50
	            },
	            fax:{
	            	digits : true,
	            	maxlength : 11
	            }
	        },
	        messages : {
	        	companyName : {
	                required : "公司名称必填"
	             
	            },
	            companyCode : {
	                required : "请填写公司编码",
	            },
	            email:{
	            	 email: "请输入一个正确的邮箱",
	            },
	            fax:{
	            	digits : "请输入数字",
	            	maxlength : "最多11位数"
	            }
	        },
	        submitHandler : function(form) {
	        	commit('companyForm', 'company/save', 'company/listUI');
	        }
	    });
	}
		]]>
	</script>